3.86 \(\int x \cos ((a+b x)^2) \, dx\)

Optimal. Leaf size=47 \[ \frac{\sin \left ((a+b x)^2\right )}{2 b^2}-\frac{\sqrt{\frac{\pi }{2}} a \text{FresnelC}\left (\sqrt{\frac{2}{\pi }} (a+b x)\right )}{b^2} \]

[Out]

-((a*Sqrt[Pi/2]*FresnelC[Sqrt[2/Pi]*(a + b*x)])/b^2) + Sin[(a + b*x)^2]/(2*b^2)

________________________________________________________________________________________

Rubi [A]  time = 0.0322894, antiderivative size = 47, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.4, Rules used = {3434, 3352, 3380, 2637} \[ \frac{\sin \left ((a+b x)^2\right )}{2 b^2}-\frac{\sqrt{\frac{\pi }{2}} a \text{FresnelC}\left (\sqrt{\frac{2}{\pi }} (a+b x)\right )}{b^2} \]

Antiderivative was successfully verified.

[In]

Int[x*Cos[(a + b*x)^2],x]

[Out]

-((a*Sqrt[Pi/2]*FresnelC[Sqrt[2/Pi]*(a + b*x)])/b^2) + Sin[(a + b*x)^2]/(2*b^2)

Rule 3434

Int[((a_.) + Cos[(c_.) + (d_.)*((e_.) + (f_.)*(x_))^(n_)]*(b_.))^(p_.)*((g_.) + (h_.)*(x_))^(m_.), x_Symbol] :
> Module[{k = If[FractionQ[n], Denominator[n], 1]}, Dist[k/f^(m + 1), Subst[Int[ExpandIntegrand[(a + b*Cos[c +
 d*x^(k*n)])^p, x^(k - 1)*(f*g - e*h + h*x^k)^m, x], x], x, (e + f*x)^(1/k)], x]] /; FreeQ[{a, b, c, d, e, f,
g, h}, x] && IGtQ[p, 0] && IGtQ[m, 0]

Rule 3352

Int[Cos[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]*FresnelC[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)])/
(f*Rt[d, 2]), x] /; FreeQ[{d, e, f}, x]

Rule 3380

Int[((a_.) + Cos[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Cos[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IntegerQ[Simpl
ify[(m + 1)/n]] && (EqQ[p, 1] || EqQ[m, n - 1] || (IntegerQ[p] && GtQ[Simplify[(m + 1)/n], 0]))

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int x \cos \left ((a+b x)^2\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \left (-a \cos \left (x^2\right )+x \cos \left (x^2\right )\right ) \, dx,x,a+b x\right )}{b^2}\\ &=\frac{\operatorname{Subst}\left (\int x \cos \left (x^2\right ) \, dx,x,a+b x\right )}{b^2}-\frac{a \operatorname{Subst}\left (\int \cos \left (x^2\right ) \, dx,x,a+b x\right )}{b^2}\\ &=-\frac{a \sqrt{\frac{\pi }{2}} C\left (\sqrt{\frac{2}{\pi }} (a+b x)\right )}{b^2}+\frac{\operatorname{Subst}\left (\int \cos (x) \, dx,x,(a+b x)^2\right )}{2 b^2}\\ &=-\frac{a \sqrt{\frac{\pi }{2}} C\left (\sqrt{\frac{2}{\pi }} (a+b x)\right )}{b^2}+\frac{\sin \left ((a+b x)^2\right )}{2 b^2}\\ \end{align*}

Mathematica [A]  time = 0.0469997, size = 42, normalized size = 0.89 \[ \frac{\sin \left ((a+b x)^2\right )-\sqrt{2 \pi } a \text{FresnelC}\left (\sqrt{\frac{2}{\pi }} (a+b x)\right )}{2 b^2} \]

Antiderivative was successfully verified.

[In]

Integrate[x*Cos[(a + b*x)^2],x]

[Out]

(-(a*Sqrt[2*Pi]*FresnelC[Sqrt[2/Pi]*(a + b*x)]) + Sin[(a + b*x)^2])/(2*b^2)

________________________________________________________________________________________

Maple [A]  time = 0.028, size = 63, normalized size = 1.3 \begin{align*}{\frac{\sin \left ({x}^{2}{b}^{2}+2\,abx+{a}^{2} \right ) }{2\,{b}^{2}}}-{\frac{\sqrt{2}a\sqrt{\pi }}{2\,b}{\it FresnelC} \left ({\frac{\sqrt{2} \left ({b}^{2}x+ab \right ) }{\sqrt{\pi }}{\frac{1}{\sqrt{{b}^{2}}}}} \right ){\frac{1}{\sqrt{{b}^{2}}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*cos((b*x+a)^2),x)

[Out]

1/2/b^2*sin(b^2*x^2+2*a*b*x+a^2)-1/2*a/b*2^(1/2)*Pi^(1/2)/(b^2)^(1/2)*FresnelC(2^(1/2)/Pi^(1/2)/(b^2)^(1/2)*(b
^2*x+a*b))

________________________________________________________________________________________

Maxima [C]  time = 2.37108, size = 266, normalized size = 5.66 \begin{align*} -\frac{b x{\left (4 i \, e^{\left (i \, b^{2} x^{2} + 2 i \, a b x + i \, a^{2}\right )} - 4 i \, e^{\left (-i \, b^{2} x^{2} - 2 i \, a b x - i \, a^{2}\right )}\right )} + 2 \, \sqrt{b^{2} x^{2} + 2 \, a b x + a^{2}}{\left (-\left (i - 1\right ) \, \sqrt{2} \sqrt{\pi }{\left (\operatorname{erf}\left (\sqrt{i \, b^{2} x^{2} + 2 i \, a b x + i \, a^{2}}\right ) - 1\right )} + \left (i + 1\right ) \, \sqrt{2} \sqrt{\pi }{\left (\operatorname{erf}\left (\sqrt{-i \, b^{2} x^{2} - 2 i \, a b x - i \, a^{2}}\right ) - 1\right )}\right )} a + a{\left (4 i \, e^{\left (i \, b^{2} x^{2} + 2 i \, a b x + i \, a^{2}\right )} - 4 i \, e^{\left (-i \, b^{2} x^{2} - 2 i \, a b x - i \, a^{2}\right )}\right )}}{16 \,{\left (b^{3} x + a b^{2}\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos((b*x+a)^2),x, algorithm="maxima")

[Out]

-1/16*(b*x*(4*I*e^(I*b^2*x^2 + 2*I*a*b*x + I*a^2) - 4*I*e^(-I*b^2*x^2 - 2*I*a*b*x - I*a^2)) + 2*sqrt(b^2*x^2 +
 2*a*b*x + a^2)*(-(I - 1)*sqrt(2)*sqrt(pi)*(erf(sqrt(I*b^2*x^2 + 2*I*a*b*x + I*a^2)) - 1) + (I + 1)*sqrt(2)*sq
rt(pi)*(erf(sqrt(-I*b^2*x^2 - 2*I*a*b*x - I*a^2)) - 1))*a + a*(4*I*e^(I*b^2*x^2 + 2*I*a*b*x + I*a^2) - 4*I*e^(
-I*b^2*x^2 - 2*I*a*b*x - I*a^2)))/(b^3*x + a*b^2)

________________________________________________________________________________________

Fricas [A]  time = 1.64091, size = 158, normalized size = 3.36 \begin{align*} -\frac{\sqrt{2} \pi a \sqrt{\frac{b^{2}}{\pi }} \operatorname{C}\left (\frac{\sqrt{2}{\left (b x + a\right )} \sqrt{\frac{b^{2}}{\pi }}}{b}\right ) - b \sin \left (b^{2} x^{2} + 2 \, a b x + a^{2}\right )}{2 \, b^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos((b*x+a)^2),x, algorithm="fricas")

[Out]

-1/2*(sqrt(2)*pi*a*sqrt(b^2/pi)*fresnel_cos(sqrt(2)*(b*x + a)*sqrt(b^2/pi)/b) - b*sin(b^2*x^2 + 2*a*b*x + a^2)
)/b^3

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x \cos{\left (a^{2} + 2 a b x + b^{2} x^{2} \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos((b*x+a)**2),x)

[Out]

Integral(x*cos(a**2 + 2*a*b*x + b**2*x**2), x)

________________________________________________________________________________________

Giac [C]  time = 1.14234, size = 161, normalized size = 3.43 \begin{align*} -\frac{-\frac{\left (i + 1\right ) \, \sqrt{2} \sqrt{\pi } a \operatorname{erf}\left (\left (\frac{1}{2} i - \frac{1}{2}\right ) \, \sqrt{2}{\left (x + \frac{a}{b}\right )}{\left | b \right |}\right )}{{\left | b \right |}} + \frac{2 i \, e^{\left (i \, b^{2} x^{2} + 2 i \, a b x + i \, a^{2}\right )}}{b}}{8 \, b} - \frac{\frac{\left (i - 1\right ) \, \sqrt{2} \sqrt{\pi } a \operatorname{erf}\left (-\left (\frac{1}{2} i + \frac{1}{2}\right ) \, \sqrt{2}{\left (x + \frac{a}{b}\right )}{\left | b \right |}\right )}{{\left | b \right |}} - \frac{2 i \, e^{\left (-i \, b^{2} x^{2} - 2 i \, a b x - i \, a^{2}\right )}}{b}}{8 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos((b*x+a)^2),x, algorithm="giac")

[Out]

-1/8*(-(I + 1)*sqrt(2)*sqrt(pi)*a*erf((1/2*I - 1/2)*sqrt(2)*(x + a/b)*abs(b))/abs(b) + 2*I*e^(I*b^2*x^2 + 2*I*
a*b*x + I*a^2)/b)/b - 1/8*((I - 1)*sqrt(2)*sqrt(pi)*a*erf(-(1/2*I + 1/2)*sqrt(2)*(x + a/b)*abs(b))/abs(b) - 2*
I*e^(-I*b^2*x^2 - 2*I*a*b*x - I*a^2)/b)/b